##
## Includes
##

include_directories(
    SYSTEM
        ${SIGCPP_INCLUDE_DIRS}
        ${CAIRO_INCLUDE_DIRS}
)

##
## Modules
##

## TODO: make configurable
## TODO: write some macros

set(MODS_ENABLED
    lyr_freetype
    lyr_std
    mod_bmp
    mod_dv
    mod_example
    mod_ffmpeg
    mod_filter
    mod_geometry
    mod_gradient
    mod_imagemagick
    mod_jpeg
    mod_noise
    mod_particle
    mod_png
    mod_svg
)

## Process selected modules
set(SYNFIG_MODULES_CONTENT "")

message("-- Synfig modules:")
foreach(MOD IN ITEMS ${MODS_ENABLED})
    message("--   ${MOD}")
    set(SYNFIG_MODULES_CONTENT "${SYNFIG_MODULES_CONTENT}\n${MOD}")
    add_subdirectory(${MOD})
endforeach(MOD)

file(WRITE synfig_modules.cfg ${SYNFIG_MODULES_CONTENT})

install(
    FILES synfig_modules.cfg
    DESTINATION etc
)
